# -*- coding: utf-8 -*-

from qcloud_cos import CosConfig
from qcloud_cos import CosS3Client

secret_id = ''  # 替换为用户的 secretId
secret_key = ''  # 替换为用户的 secretKey
region = ''  # 替换为用户的 Region

config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key)

client = CosS3Client(config)

response = client.upload_file(
    Bucket='ydc-1302759476',  # 桶的名称
    LocalFilePath='index-1.png',  # 本地要上传的文件路径
    Key='cow.jpg',
)

print(response['ETag'])
